from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    print('XPATH的text定位')
    def so(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜商品名称 作者 出版社 ISBN"]')
        ele=self.find_ele(loc)
        return ele
    #CLASS_NAME定位
    def sosou(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    #ID定位
    def an(self):
        loc=(By.ID,'com.kongfz.app:id/tvSearch')
        ele=self.find_ele(loc)
        return ele
    def jiaru(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("").instance(0)')
        ele=self.find_ele(loc)
        return ele
    def chakan(self):
        loc=(By.XPATH,'(//android.widget.TextView[@text=""])[3]')
        ele=self.find_ele(loc)
        return ele
    #XPATH的resource-id定位
    def quan(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/icon_font_choice_all"]')
        ele=self.find_ele(loc)
        return ele
    #坐标定位
    def guan(self):
        self.qiao(650,175)
    def jiesuan(self):
        loc=(By.ID,'com.kongfz.app:id/tv_close_account')
        ele=self.find_ele(loc)
        return ele
    #提示添加地址
    def duanyan(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tv_left"]')
        ele=self.find_ele(loc)
        return ele